-
Notifications
You must be signed in to change notification settings - Fork 165
[terra-search-field] Update search field focus indicator to standard dashed line #3834
Conversation
outline: var(--terra-search-field-focus-keyboard-outline, 2px dashed #000); | ||
outline-offset: var(--terra-search-field-focus-keyboard-outline-offset, 1px); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern is showing up a lot in our code with the accessibility updates. Should this be converted to a mixin that can be reused or some other reusable concept? It is used 3 times in this file alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline with Charles and team: will need to discuss as team the default focus indicators for each theme and go forward strategy to implement in a way that all components will receive a consistent styling
@@ -47,7 +47,9 @@ | |||
} | |||
|
|||
&:focus { | |||
border-color: var(--terra-search-field-button-focus-border-color, #26a2e5); | |||
box-shadow: var(--terra-search-field-clear-focus-box-shadow); | |||
outline: var(--terra-search-field-focus-keyboard-outline, 2px dashed #000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this scenario, can't we create one descendant focus pseudo selector to cover all the use cases under the search field? I don't think we should have to add a selector for each type of element. I think this could make it so that you only have to maintain one style block for the focus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,7 +9,7 @@ Terra.describeViewports('Search Field', ['medium'], () => { | |||
}); | |||
|
|||
it('should enter a search term', () => { | |||
$('input').setValue('Lore'); | |||
$('input').setValue('Lore', { mismatchTolerance: 0.1 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what is the reason for the mismatchTolerance being set??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Thanks!
Can you add a comment indicating why this was added for documentation purposes? Something like:
Setting the mismatchTolerance to 0.1 to account for subtle variances in the dotted line.
(Or whatever wording is more accurate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Added comments for the new mismatchTolerances here 0ef9818
4875aea
to
7580abd
Compare
@@ -2,6 +2,9 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Changed | |||
* Updated focus indicators to standard dashed line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Updated focus indicators to standard dashed line. | |
* Updated focus indicators to be a standard dashed line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated changelog here: 32d5c76#diff-9a64312164f2dbc2f8fde50e49118667ef236e6f49d7b535dab2b1191ff3df50
--terra-search-field-input-focus-keyboard-outline: none; | ||
--terra-search-input-field-focus-keyboard-outline-offset: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--terra-search-field-input-focus-keyboard-outline: none; | |
--terra-search-input-field-focus-keyboard-outline-offset: none; | |
--terra-search-field-input-focus-keyboard-outline: none; | |
--terra-search-input-field-focus-keyboard-outline-offset: none; |
not able to find these variables on other themes !! are these variables required ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, these are no longer needed and have been removed here d61bf2c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful! 😙👌
0613c07
to
d61bf2c
Compare
Summary
What was changed:
Changed the search field's focus indicators to standard Terra dashed line for Terra themes. For Orion Fusion theme, there is still ongoing discussion about the styling so the only change for Orion Fusion is adding the box shadow to the input field to match the buttons to increase the visibility of the focus indicator.
Why it was changed:
Focus indicator consistency with other components
Testing
This change was tested using:
Terra Default:
Terra Lowlight:
Orion Fusion:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-8109
Thank you for contributing to Terra.
@cerner/terra